package com.prs.crm.service.approval.impl;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.prs.crm.dao.approval.AppDataDemandDao;
import com.prs.crm.domain.approval.AppDataDemand;
import com.prs.crm.domain.approval.ShenQingType;
import com.prs.crm.service.approval.AppDataDemandService;
import com.prs.crm.service.impl.BaseServiceImpl;

public class AppDataDemandServiceImpl extends BaseServiceImpl<AppDataDemand, AppDataDemandDao> implements AppDataDemandService{

	@Override
	public Collection<ShenQingType> convertByType(String ids) {
		try{
		Collection<ShenQingType> shenQingTypes=new ArrayList<ShenQingType>();
		for (String id : ids.split(",")) {
			System.out.println(id);
			System.out.println(ids);
			ShenQingType shenQingType=new ShenQingType();
			shenQingType.setId(Integer.parseInt(id));
			shenQingTypes.add(shenQingType);
		}
		return shenQingTypes;
	}catch (NumberFormatException e) {
		e.printStackTrace();
		return null;
		}	
	}

	@Override
	public List<AppDataDemand> getAllAppDataDemand() {
		return this.getDao().getAllAppDataDemand();
	}

}
